package com.twu.biblioteca;

import java.util.Scanner;


public class Librarian {

    Register register = new Register();
    String isbn = null;


    public int  DetermineOperation(int action){
        switch(action){
            case 1 :register.DisplayBooks();
                break;

            case 2: register.DisplayMovies();
                break;

            case 4: CheckOutBook(isbn);
                break;

            case 3: ReturnBook(isbn);

                break;
            case 5: CheckOutMovie();
                break;

            case 6: DisplayAccountInfo();
               break;

            case 7: return 0;

        }
    return action;


    }

    private void DisplayAccountInfo() {

    }

    private String CheckOutMovie() {
        Scanner sc = new Scanner(System.in);
        System.out.println("Please enter the name of the movie to be issued :");

        String movieName = sc.next();
        register.removeMovie(movieName);

        return movieName;

    }

    public String CheckOutBook(String isbn){

        Scanner sc = new Scanner(System.in);
        System.out.println("Please enter the ISBN of the book to be issued :");

        isbn = sc.next();
        register.removeBook(isbn);

        return isbn;


        }

    public void ReturnBook(String isbn){

        Scanner sc = new Scanner(System.in);
        System.out.println("Please enter the ISBN of the book to be issued :");

     isbn = sc.next();
        register.addBook(isbn);
        System.out.println("Thank you for returning the book!");
    }

}
